<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>angular事件</title>
    <script src="../js/angular.min.js"></script>
</head>
<body>
<!--<div ng-app="myApp" ng-controller="myCtrl">
    <button ng-click="count=count+1">click  it !</button>
    <p>{{count}}</p>
</div>
<script>
    var app=angular.module("myApp",[]);
    app.controller("myCtrl", function ($scope) {
        $scope.count=0;
    });
</script>-->
<div ng-app="myApp" ng-controller="myCtrl">
    <button ng-click="toggle()">click it!</button>
    <p ng-hide="myVar">
        firsTName:{{firstName}}<br>
        lastName:{{lastName}}<br>
    </p>
</div>
<script>
    var app=angular.module("myApp",[]);
    app.controller("myCtrl", function ($scope) {
        $scope.firstName="John";
        $scope.lastName="Doe";
        $scope.toggle= function () {
            $scope.myVar=!$scope.myVar;
        }
    });
</script>
</body>
</html>